package logging

import (
	"fmt"

	"github.com/go-apibox/logging"
)

func SetAPIBOXLogging(l *logging.Logger) {
	defaultLogging = &LoggerAPIBOX{
		Logger: l,
	}
}

type LoggerAPIBOX struct {
	*logging.Logger
}

func (lop *LoggerAPIBOX) Debugln(v ...interface{}) {
	lop.Logger.Debug(v)
}
func (lop *LoggerAPIBOX) Errorln(v ...interface{}) {
	lop.Logger.Error(v)
}

func (lop *LoggerAPIBOX) Fatalln(v ...interface{}) {
	lop.Logger.Fatal(v)
}
func (lop *LoggerAPIBOX) Infoln(v ...interface{}) {
	lop.Logger.Info(v)
}

// func (lop *LoggerOP) Infoln(v ...interface{}) {
// 	lop.Logger.Info(fmt.Sprintln(v))
// }

func (lop *LoggerAPIBOX) Warningln(v ...interface{}) {
	lop.Logger.Warning(fmt.Sprintln(v))
}
